<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<title>[%$ESPCMS_SOFT_TITLE%]</title>
		<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_font_icon.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_style_public.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_all.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_framework.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/espcms_select.css" rel="stylesheet" type="text/css" />
		<link href="[%$ESPCMS_ADMIN_TEMPLATES_URL%]css/pageload.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery-ui.min.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/jquery.cookie.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_dialog.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/md5.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/json.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/bootstrap.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/lngpack_cn.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_form.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_formvalidation.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_dialog.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_function.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_tool.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_page.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_select.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_checkbox.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_select_checkbox.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_batch.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_tab.js"></script>
		<script type="text/javascript" src="[%ESPCMS_ADMIN_URL%]js/espcms_multiple.js"></script>
		<script type="text/javascript">
			$(document).ready(function () {
				banpageKey();
				$.ajax({
					type: "post",
					url: "[%$link.execute%]",
					dataType: 'json',
					global: false,
					data: {appid: '[%$appid%]'},
					success: function (data) {
						if (data.length > 0) {

							var valuemin = 100 / data.length;
							valuemin = valuemin.toFixed(2);

							update_execute(data, 0, data.length, valuemin);
							$('#load_div').show();
							$('#espcms_save_cancel').attr('disabled', 'disabled');
						} else {
							parent.$.espcms_sticky('[%pack:setting_pack-espcms_extensions_update_message_no2%]', {'autoclose': 1500});
							parent.closeifram();
							return false;
						}
					}
				});
				$('.espcms_save_cancel').click(function () {
					parent.closeifram();
				});
			});

			function update_execute(softdata, limit_num, pack_num, valuemin) {
				if (limit_num >= pack_num) {
					parent.$.espcms_sticky('[%pack:setting_pack-espcms_extensions_update_message_ok%]', {'autoclose': 1500});
					parent.frames['[%$iframes_name%]'].refresh('ajax_list');
					parent.closeifram();
					return false;
				}
				$('#return_num').empty().append(softdata[limit_num]['volstr']);
				$.ajax({
					type: "post", url: "[%$link.viewpack%]",
					dataType: 'json',
					data: {appid: '[%$appid%]', uid: softdata[limit_num]['uid'], app_market_id: softdata[limit_num]['app_market_id']}, global: false,
					success: function (data) {
						limit_num = limit_num + 1;
						var valuenow = Math.round(valuemin * limit_num);
						$('#progress_bar').attr('aria-valuenow', valuenow);
						$('#progress_bar').css('width', valuenow + '%');
						$('#progress_bar').empty().append(valuenow + '%');
						if (data.isreset == 1) {
							parent.parent.locationout();
							return true;
						}
						update_execute(softdata, limit_num, pack_num, valuemin);
					}
				});
			}
		</script>
	</head>

	<body class="dialog_body">
		<form class="form-horizontal admin-form" id="espcms_saveInfo" action="[%$link.execute%]">
			<input type="hidden" name="token_key" id="token_key" value="[%$token.token_key%]"/>
			<input type="hidden" name="token_name" id="token_name" value="[%$token.token_name%]"/>
			<div class="panel-body displaynone" style="padding-top:60px;" id="load_div">
				<div class="col-md-12 center mb10 mt15 f24" id="loading">[%pack:setting_pack-espcms_update_loading_title%]</div>
				<div class="col-md-12 center mb10 mt15"><span id="return_num"></span>[%pack:setting_pack-espcms_update_loading_title2%]</div>
				<div class="progress" id="progress">
					<div class="progress-bar progress-bar-danger" id="progress_bar"  role="progressbar" aria-valuenow="60" aria-valuemin="0" aria-valuemax="100" style="width: 60%"></div>
				</div>
			</div>
			<div class="dialogbotton">
				<div class="dialog_buttonset">
					<button type="button" id="espcms_save_cancel" class="btn btn-lightgray min-w-150 espcms_save_cancel" disabled="disabled">[%pack:botton_pack-espcms_botton_close_dialog%]</button>
				</div>
			</div>
		</form>
	</body>
</html>
